/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblsexo")
@NamedQueries({
    @NamedQuery(name = "Tblsexo.findAll", query = "SELECT t FROM Tblsexo t"),
    @NamedQuery(name = "Tblsexo.findByIdSexo", query = "SELECT t FROM Tblsexo t WHERE t.idSexo = :idSexo"),
    @NamedQuery(name = "Tblsexo.findByDesSexo", query = "SELECT t FROM Tblsexo t WHERE t.desSexo = :desSexo")})
public class Tblsexo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "id_sexo")
    private String idSexo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "des_sexo")
    private String desSexo;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblsexo() {
    }

    public Tblsexo(String idSexo) {
        this.idSexo = idSexo;
    }

    public Tblsexo(String idSexo, String desSexo) {
        this.idSexo = idSexo;
        this.desSexo = desSexo;
    }

    public String getIdSexo() {
        return idSexo;
    }

    public void setIdSexo(String idSexo) {
        this.idSexo = idSexo;
    }

    public String getDesSexo() {
        return desSexo;
    }

    public void setDesSexo(String desSexo) {
        this.desSexo = desSexo;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSexo != null ? idSexo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblsexo)) {
            return false;
        }
        Tblsexo other = (Tblsexo) object;
        if ((this.idSexo == null && other.idSexo != null) || (this.idSexo != null && !this.idSexo.equals(other.idSexo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + desSexo + "";
    }
    
}
